<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="/memberLogin/js/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
	$("#myInfo").on("click",function(){
		$.ajax({
			"url":"/Yogiro/member.do",
			"type":"post",
			"data":{"method":"myInfo"},
			"dataType":"json",
			"success":function(txt){
				alert("회원정보 : "+txt);
			},
			"error":function(xhr, status, error){
				alert("정보조회중 오류 발생 : "+error);
			}
		});
	});
});

function del() {
	var del = confirm("탈퇴를 하시려는것이 맞습니까?");
	if(del){
		document.memberDelete.submit();
	}else{
		return;
	}
}
</script>
<title>Insert title here</title>
</head>
<body>
<div style="padding: 10px; margin-top: 20px" align="left">
${sessionScope.mto.memberName }님 의 정보<br><p>
<input type="submit" id=myInfo value="내정보 보기">	<br>
<a href="/Yogiro/member.do?method=logout">로그아웃</a><br>
<a href="/Yogiro/member.do?method=selectMemberList">전체회원정보</a>

<form action="/Yogiro/member.do" name="memberDelete">
<input type="hidden" name="method" value="deleteMember">
<input type="button" value="회원탈퇴" onclick="del()">
</form>

<form action="/Yogiro/member.do" >
<input type="hidden" name="method" value="setInfo">
<input type="hidden" name="Info" value="1">
<input type="submit" value="자기정보수정">
</form>

<c:if test="${sessionScope.mto.memberLevel=='0' }">
<a href="message.do?method=listController">쪽지함</a><br>
</c:if>
<c:if test="${sessionScope.mto.memberLevel=='1' }">
<a href="message.do?method=ClientListController">쪽지함</a>
</c:if>
</div>
</body>
</html>